package ch06;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test1 {
    private static ApplicationContext applicationContext ;
    static {
        applicationContext = new ClassPathXmlApplicationContext("ch06/spring1.xml") ;
    }

    public static  void test1(){
        PersonDao personDao = (PersonDao) applicationContext.getBean("personDao") ;
        personDao.del(1);
    }
    public static  void test2(){
        UserService userService = (UserService) applicationContext.getBean("userService") ;
        userService.show();
    }

    public static void main(String[] args) {
       test2();
    }
}
